package com.example.index.system

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.example.index.R
import com.example.index.adapter.FooViewBinder
import com.example.index.adapter.foo.Foo
import com.example.index.extension.setImmersive
import kotlinx.android.synthetic.main.activity_coordinator_layout_fit_system_window.*
import me.drakeet.multitype.MultiTypeAdapter

class CoordinatorLayoutFitSystemWindowActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_coordinator_layout_fit_system_window)
        window.setImmersive()
        fillRv()
    }

    private fun fillRv() {
        val adapter = MultiTypeAdapter()
        staticRV.adapter = adapter

        adapter.register(FooViewBinder())
        adapter.items = kotlin.run {
            val list = ArrayList<Foo>()
            for (i in 0..25)
                list.add(Foo(("pos $i")))

            list
        }

        adapter.notifyDataSetChanged()
    }
}
